package cn.hxzy.common.config;

import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Configuration
@Data
@ConfigurationProperties("oss")
public class OssConfig implements InitializingBean {

    private String endpoint;
    private String bucketName;
    private String keyId;
    private String keySecret;

    public static String ENDPOINT;
    public static String BUCKETNAME;
    public static String KEYID;
    public static String KEYSECRET;


    @Override
    public void afterPropertiesSet() throws Exception {
        ENDPOINT=this.endpoint;
        BUCKETNAME=this.bucketName;
        KEYID=this.keyId;
        KEYSECRET =this.keySecret;
    }
}
